<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<ui:composition template="/templates/layout.xhtml">
	<ui:define name="body">
		<p:growl id="growl" showDetail="true" />
		<h:form styleClass="login"
			style="margin:auto; border-radius: 5px; margin:auto;">
			<c:choose>
				<c:when test="${empty param.session_expired}">
				</c:when>
				<c:otherwise>
					<p:confirmDialog showEffect="fade" widgetVar="sessionDialog"
						header="#{msg.frsErrorExpiroSesion  }"
						message="#{msg.frsInactividad}" visible="true">
						<p:commandButton value="#{msg.aceptar }"
							oncomplete="sessionDialog.hide()" />
					</p:confirmDialog>
				</c:otherwise>
			</c:choose>
			<c:choose>
				<c:when test="${empty param.access_not_allowed}">
				</c:when>
				<c:otherwise>
					<p:confirmDialog showEffect="fade" widgetVar="sessionDialog2"
						header="#{msg.frsAccesoNo  }"
						message="#{msg.frsAccesoNoPermitido}" visible="true">
						<p:commandButton value="#{msg.aceptar }"
							oncomplete="sessionDialog2.hide()" />
					</p:confirmDialog>
				</c:otherwise>
			</c:choose>
			<fieldset
				style="text-align: center; border: 2px solid black; border-radius: 5px; margin: auto;">
				<legend>#{msg.login}</legend>
				<p></p>
				<h:panelGrid columns="2" style="text-align:right; margin:auto;">
					<h:outputLabel value="#{msg.usuario}:" for="j_username" />
					<h:inputText id="j_username" value="#{beanLogin.userName}"
						title="#{msg.usuario}" maxlength="20" required="true"
						requiredMessage="#{msg.usuarioRequerido}" />
					<h:outputLabel value="#{msg.contrasenia}:" for="j_password" />
					<h:inputSecret id="j_password" value="#{beanLogin.password}"
						title="#{msg.contrasenia}" maxlength="20" required="true"
						requiredMessage="#{msg.contraseniaRequerida}" />
				</h:panelGrid>
				<p></p>
				<h:panelGrid
					style="text-align:left;height: 50px; width: 100px;	margin:auto;">
					<h:outputLabel value="#{msg.captcha} :" />
					<p:captcha label="Captcha" />
				</h:panelGrid>
				<p></p>
				<p:commandButton ajax="false" action="#{beanLogin.login}"
					value="#{msg.aceptar}" />
			</fieldset>
			<br />

		</h:form>
	</ui:define>
</ui:composition>

</html>
